package main

import (
	"05demo-gin-gorm-swagger/database"
	"05demo-gin-gorm-swagger/route"
	//swaggerFiles "github.com/swaggo/gin-swagger/swaggerFiles"
)

func main() {

	// 连接数据库
	database.InitDb()
	// 初始化路由
	router := route.InitRouter()

	//swagger config
	//config := &ginSwagger.Config{
	//	URL: "http://localhost:8080/swagger/doc.json", //The url pointing to API definition
	//}
	//url := ginSwagger.URL("http://127.0.0.1:8080/swagger/doc.json")
	//router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
	//router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	//url := ginSwagger.URL("http://127.0.0.1:8080/swagger/doc.json")
	//router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url))
	//ginSwagger.WrapHandler(swaggerFiles.Handler,
	//	ginSwagger.URL("http://localhost:8080/swagger/doc.json"),
	//	ginSwagger.DefaultModelsExpandDepth(-1))

	router.Run(":8080")

}
